const Utils = {
  image (url) {
    return this.$createElement({
      render: (h) => {
        return (<span>{
          url.split(',').map((item) => {
            return (<a href={item || 'javascript:;'} target={item ? '_blank' : '_self'}><a-avatar style="margin-right: 2px;" shape="square" size={40} icon={item ? '' : 'user'} src={item}/></a>)
          })
        }</span>)
      }
    })
  },
  dialog (vm, component, componentProps, modalProps) {
    modalProps = Object.assign({}, {
      width: '80%',
      bodyStyle: {
        minHeight: '600px',
        maxHeight: '600px',
        overflowY: 'auto'
      },
      dialogStyle: {
        top: '6%'
      },
      footer: false
    }, modalProps)
    vm.$dialog(component, componentProps, modalProps)
  }
}

export default Utils
